<template>
	<view>
		<u-navbar placeholder fixed autoBack border title="个人信息"></u-navbar>
		<view class="d-p-30" v-if="user">
			<view class="card d-p-l-30 d-p-r-30">
				<view class="d-flex item u-border-bottom">
					<view class="label d-flex-1">姓名</view>
					<view class="d-font-28">{{ user.userName }}</view>
				</view>
				<view class="d-flex item u-border-bottom">
					<view class="label d-flex-1">头像</view>
					<view class="d-font-28"><u-avatar size="68rpx" :src="user.profile || '/static/image/photo.png'"></u-avatar></view>
				</view>
				<view class="d-flex item u-border-bottom">
					<view class="label d-flex-1">性别</view>
					<view class="d-font-28">{{ $user.sex }}</view>
				</view>
				<view class="d-flex item u-border-bottom">
					<view class="label d-flex-1">账号</view>
					<view class="d-font-28">{{ user.acc }}</view>
				</view>
				<view class="d-flex item u-border-bottom">
					<view class="label d-flex-1">手机号</view>
					<view class="d-font-28"><u--text size="28rpx" mode="phone" call :text="user.phone"></u--text></view>
				</view>
				<view class="d-flex item u-border-bottom">
					<view class="label d-flex-1">角色</view>
					<view class="d-font-28">{{ user.gwlx_label }}</view>
				</view>
				<view class="d-flex item u-border-bottom">
					<view class="label d-flex-1">单位名称</view>
					<!-- <view class="d-font-28">{{ user.ssgcxx[$appIndex].deptName }}</view> -->
					<view class="d-font-28">{{ user.deptName }}</view>
				</view>
				<view class="d-flex item">
					<view class="label d-flex-1">行政区域</view>
					<!-- 没有返回 -->
					<view class="d-font-28">{{ user.districtName }}</view>
				</view>
			</view>

			<view class="card d-m-t-30 d-p-30">
				<view class="d-font-28">我的企业</view>
				<view class="d-m-t-30">
					<view class="d-flex item-min">
						<view class="label">企业名称</view>
						<view class="d-flex-1 d-font-28 val d-text-right d-p-l-30">{{ user.ssqymc || '暂无数据源' }}</view>
					</view>
					<view class="d-flex item-min">
						<view class="label d-flex-1">联系人</view>
						<view class="d-font-28 val">{{ user.ssgc_contactname || '暂无数据源' }}</view>
					</view>
					<view class="d-flex item-min">
						<view class="label d-flex-1">联系电话</view>
						<view class="d-font-28 val">
							<u--text mode="phone" :customStyle="{ fontWeight: 'bold' }" :text="user.ssgc_contactphone || '暂无数据源'" size="28rpx" :call="true"></u--text>
						</view>
					</view>
					<view class="d-flex item-min">
						<view class="label d-flex-1">单位类型</view>
						<view class="d-font-28 val">{{ user.ssqy_dwlx || '暂无数据源' }}</view>
					</view>
					<view class="d-flex item-min">
						<view class="label d-flex-1">单位电话</view>
						<view class="d-font-28 val">
							<u--text mode="phone" :customStyle="{ fontWeight: 'bold' }" :text="user.ssqy_dwdh || '暂无数据源'" size="28rpx" :call="true"></u--text>
						</view>
					</view>
					<view class="d-flex item-min">
						<view class="label">单位地址</view>
						<view class="d-font-28 val d-flex-1 d-p-l-30 d-text-right">{{ user.ssqy_dwdz || '暂无数据源' }}</view>
					</view>
				</view>
			</view>

			<view class="card d-m-t-30 d-p-30">
				<view class="d-font-28">我的项目</view>
				<view class="d-m-t-30">
					<view class="d-flex item-min">
						<view class="label">项目名称</view>
						<view class="d-flex-1 d-font-28 val d-text-right d-p-l-30">{{ user.ssgcmc || '暂无数据源' }}</view>
					</view>
					<view class="d-flex item-min">
						<view class="label d-flex-1">项目类型</view>
						<view class="d-font-28 val">{{ user.ssgc_xmtype || '暂无数据源' }}</view>
					</view>
					<view class="d-flex item-min">
						<view class="label d-flex-1">建设阶段</view>
						<view class="d-font-28 val">{{ user.ssgc_jsjd || '暂无数据源' }}</view>
					</view>
					<view class="d-flex item-min">
						<view class="label d-flex-1">项目负责人</view>
						<view class="d-font-28 val">{{ user.ssgc_contactname || '暂无数据源' }}</view>
					</view>
					<view class="d-flex item-min">
						<view class="label d-flex-1">联系电话</view>
						<view class="d-font-28 val">
							<u--text mode="phone" :customStyle="{ fontWeight: 'bold' }" 
								text="未查找到相关字段" size="28rpx" :call="true">
								<!-- :text="user.ssgc_contactphone" size="28rpx" :call="true"> -->
							</u--text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import { getUserInfo,getDictInfo } from '../../common/api.js';
export default {
	data() {
		return {
			user: null
		};
	},
	onLoad() {
		this.init();
	},
	methods: {
		init() {
			uni.showLoading({
				title: '加载中...',
				mask: true
			});
			getUserInfo().then(e => {
				this.user = e.data;
				// uni.$u.vuex('$user', e.data);
				uni.hideLoading();
			});
		},
	}
};
</script>

<style lang="scss">
page {
	background-color: #fbfcfc;
	.card {
		background: #ffffff;
		box-shadow: 0rpx 5rpx 10rpx rgba(0, 0, 0, 0.05);
		border-radius: 10rpx;
		color: #162233;
		.item {
			height: 100rpx;
			.label {
				font-size: 30rpx;
				font-weight: 400;
				color: #5d6672;
			}
		}
		.item-min {
			min-height: 60rpx;
			.label {
				font-size: 28rpx;
				color: #5d6672;
			}
			.val {
				font-weight: bold;
			}
		}
	}
}
</style>
